<?php 
	//直接使用函数的方式进行操作
	
	//$arr = array(1, 2, 3, 4, 5);
	$arr = array('one' => 1, 'two' => 2, 'three' => 3, "four" => 4);
	print_r($arr);
	echo "<br />";

	array_walk($arr, "myfun");

	print_r($arr);
	echo "<br />";

	function myfun($value, $key)
	{
		echo $key."------>".$value."<br>";
	}
	echo "<hr>";

	//采用匿名函数的方式进行操作
	$arr1 = array('one' => 1, 'two' => 2, 'three' => 3, "four" => 4);	
	array_walk($arr1, function($value, $key){
		echo $key."->".$value."<br>";
	});
	echo "<hr>";

	
	//采用传多个函数的值的形式进行操作
	$arr2 = array('one' => 1, 'two' => 2, 'three' => 3, "four" => 4);
	array_walk($arr2, function($value, $key, $string){
		echo $key;
		echo $string;
		echo $value;
	}, "->")


 ?>